﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Logic.ClarizenSvc;

namespace Logic.ClarizenObjects
{
    public class Project : WorkItem
    {

         

        public Project(GenericEntity entity)
            : base(entity)
        {
            
        }

        public String Description { get; set; }


        public Project()
        {
        }

        public static EntityId GetDefault()
        {
            var qc = new QueryComponent();
            var wi = qc.GetWorkItems(WorkItemType.Project, WorkItemFilter.All, WorkItemState.All, Logic.Constants.DEFAULT_TASK_CONTAINER);
            if (wi.Count == 0)
                return qc.CreateEntity(new Project { Name = Logic.Constants.DEFAULT_TASK_CONTAINER }.ToGenericEntity());
            else return wi[0].ID;
        }
    }
}